Add baseline CoderControlPlane controller-runtime scaffolding#2
Conversation
Introduce baseline controller-runtime scaffolding for CoderControlPlane, including API types, scheme registration, generated deepcopy methods, reconciler skeleton, manager wiring, and smoke tests. Also replace the placeholder codegen target with a repeatable vendored deepcopy generation script. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a009507da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Configure controller-runtime manager with a non-empty HealthProbeBindAddress so healthz/readyz endpoints are actually served, and add a unit test guarding against disabling probe binding. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
|
Addressed the Codex probe-server feedback in b673f25 by setting |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds baseline controller-runtime scaffolding for a new
CoderControlPlaneAPI and controller.Changes
api/v1alpha1package with group/version registration andCoderControlPlanetypes.internal/controller/CoderControlPlaneReconcilerscaffold with no-op reconcile flow and RBAC markers.main.gowith controller-runtime manager bootstrap and reconciler wiring.make codegentarget with a repeatable vendored deepcopy generator script.Validation
make codegenmake testmake buildmake verify-vendor📋 Implementation Plan
Plan: Add baseline
CoderControlPlanecontroller-runtime scaffoldingContext / Why
The repository is currently a bootstrap "hello world" binary. This PR should introduce a minimal but extensible controller-runtime scaffold for a new resource
CoderControlPlanewith only placeholder API fields (spec.imageand a placeholder status field). The goal is to create a clean template that future PRs can copy for additional resources/controllers, without prematurely adding business logic.Evidence
349d2b2a6f: no existing API types/CRDs/controllers; recommendedapi/v1alpha1+ controller skeleton layout.7e4a92efeb: no manager/controller wiring yet;main.gois still hello-world and needs controller-runtime manager setup.main.go(lines 1-16): printshello world; no Kubernetes manager bootstrap.main_test.go(lines 1-11): only testshelloMessage().Makefile(lines 1-28): has vendor/test/build plus placeholdercodegenecho target.go.mod(lines 5-10): already includessigs.k8s.io/controller-runtime,k8s.io/apimachinery, andk8s.io/client-go, so baseline deps for scaffolding are present.api/,internal/controller/, orconfig/scaffold exists yet.These sources are sufficient because they confirm this PR must establish first-time scaffolding rather than extending existing controller code.
Implementation details (ordered)
Create API group/version package for CR registration
api/v1alpha1/doc.goandapi/v1alpha1/groupversion_info.go.GroupVersion,SchemeBuilder, andAddToSchemeso future resources can register in the same package.Add
CoderControlPlaneAPI type with placeholder spec/statusapi/v1alpha1/codercontrolplane_types.gocontaining:CoderControlPlaneSpecwith placeholder field:Image string \json:"image,omitempty"``CoderControlPlaneStatuswith a placeholder (e.g.Phase string).CoderControlPlane,CoderControlPlaneList).object:root,subresource:status) so this shape can become CRD/RBAC generation input later.SchemeBuilder.Register(...).Add controller skeleton with no-op reconcile
internal/controller/codercontrolplane_controller.gowith:CoderControlPlaneReconcilerstruct (client.Client,Scheme *runtime.Scheme).Reconcile(ctx, req)that fetches the object and exits without business logic.SetupWithManager(mgr)usingFor(&v1alpha1.CoderControlPlane{}).Replace hello-world entrypoint with manager wiring
main.goto initialize a controller-runtime manager:client-gobuilt-ins +api/v1alpha1.CoderControlPlaneReconciler.helloMessage()usage from runtime path; convert to standard controller bootstrap logging/error handling.Update tests from hello-world to scaffold smoke checks
main_test.gohello-world assertion.CoderControlPlaneGVK, optional lightweight setup test).Tighten build/codegen ergonomics just enough for repeatability
Makefilesocodegenis no longer a placeholder message; make it run whichever generation step is chosen for this PR (at minimum deepcopy generation workflow or explicit TODO-backed command stub used by CI/docs).Why keep this minimal?
This PR’s purpose is structural scaffolding. Avoid introducing broad deployment manifests or full envtest harness unless strictly required for compilation/testing. The next PRs can incrementally add richer generation, manifests, and reconcile behavior.
Validation plan
make test.make build.codegenis updated in this PR, runmake codegenand ensure generated artifacts are committed andmake teststill passes.Out of scope for this PR
Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh